package com.ylyq.ylxx.model.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @ClassName OceanenginePlanInfo
 * @Description TODO
 * @Author xiaweichao
 * @Date 2020/6/29 13:41
 * @Version 1.0
 */
@NoArgsConstructor
@Data
@ApiModel(value = "获取广告计划响应参数")
public class OceanenginePlanInfo {

    /**
     * message : OK
     * code : 0
     * data : {"list":[{"campaign_id":111,"id":222,"name":"xxx","ad_create_time":"2019-01-01","ad_modify_time":"2019-01-01"},{"campaign_id":333,"id":666,"name":"xxx","ad_create_time":"2019-01-01","ad_modify_time":"2019-01-01"}],"page_info":{"page":1,"page_size":10,"total_number":2,"total_page":1}}
     */

    private String message;
    private int code;
    private DataBean data;

    @NoArgsConstructor
    @Data
    @ApiModel(value = "获取广告计划响应内容")
    public static class DataBean {
        /**
         * list : [{"campaign_id":111,"id":222,"name":"xxx","ad_create_time":"2019-01-01","ad_modify_time":"2019-01-01"},{"campaign_id":333,"id":666,"name":"xxx","ad_create_time":"2019-01-01","ad_modify_time":"2019-01-01"}]
         * page_info : {"page":1,"page_size":10,"total_number":2,"total_page":1}
         */

        private PageInfoBean page_info;
        private List<ListBean> list;

        @NoArgsConstructor
        @Data
        @ApiModel(value = "获取广告计划响应内容分页信息")
        public static class PageInfoBean {
            /**
             * page : 1
             * page_size : 10
             * total_number : 2
             * total_page : 1
             */

            private int page;
            private int page_size;
            private int total_number;
            private int total_page;
        }

        @NoArgsConstructor
        @Data
        @ApiModel(value = "获取广告计划响应内容实体")
        public static class ListBean {
            /**
             * campaign_id : 111
             * id : 222
             * name : xxx
             * ad_create_time : 2019-01-01
             * ad_modify_time : 2019-01-01
             */
            @ApiModelProperty(value = "广告组ID")
            private Long campaign_id;
            @ApiModelProperty(value = "计划ID")
            private Long id;
            @ApiModelProperty(value = "广告预算")
            private Double budget;
            @ApiModelProperty(value = "广告出价")
            private Double bid;
            @ApiModelProperty(value = "广告主ID")
            private Long advertiser_id;
            @ApiModelProperty(value = "ocpm广告转化出价，如果是OCPM、OCPC、CPA出价方式方式返回此字段")
            private Double cpa_bid;
            @ApiModelProperty(value = "是否调整自动出价，意味如果逾期成本不在范围内将在此基础上调整，仅OCPM支持，当smart_bid_type=SMART_BID_CONSERVATIVE时选填。当smart_bid_type为\"SMART_BID_CONSERVATIVE\"且adjust_cpa=0时，cpa_bid由系统自动计算；\n" +
                    "            当smart_bid_type为\"SMART_BID_CONSERVATIVE\" 且adjust_cpa=1时，cpa_bid必填\n" +
                    "            允许值: \"0\", \"1\"\n" +
                    "            默认值: 0")
            private Long adjust_cpa;
            @ApiModelProperty(value = "计划名称")
            private String name;
            @ApiModelProperty(value = "深度优化方式，详见【附录-深度优化方式】")
            private String deep_bid_type;
            @ApiModelProperty(value = "深度优化出价，deep_bid_type=DEEP_BID_MIN时此字段有值")
            private Long deep_cpabid;
            @ApiModelProperty(value = "深度转化ROI系数")
            private Long roi_goal;
            @ApiModelProperty(value = "鲁班ROI出价策略系数")
            private Long luban_roi_goal;
            @ApiModelProperty(value = "自动出价类型，OCPM支持，详见【附录-自动出价类型】允许值: \"SMART_BID_CUSTOM\", \"SMART_BID_CONSERVATIVE\"")
            private String smart_bid_type;
            @ApiModelProperty(value = "广告出价类型, 详见【附录-广告出价类型】")
            private String pricing;
            @ApiModelProperty(value = "投放范围。详见【附录-投放范围】默认值: DEFAULT;允许值: \"DEFAULT\", \"UNION\"")
            private String delivery_range;
            @ApiModelProperty(value = "穿山甲视频创意类型。详见【附录-穿山甲视频创意类型】 默认值: ORIGINAL_VIDEO\n" +
                    "            允许值: \"ORIGINAL_VIDEO\", \"REWARDED_VIDEO\", \"SPLASH_VIDEO\"")
            private String union_video_type;
            @ApiModelProperty(value = "广告预算类型, 详见【附录-预算类型】")
            private String budget_mode;
            @ApiModelProperty(value = "计划创建时间")
            private String ad_create_time;
            @ApiModelProperty(value = "计划上次修改时间")
            private String ad_modify_time;
            @ApiModelProperty(value = "上次修改时间戳(用于更新计划时提交,服务端判断是否基于最新信息修改)")
            private String modify_time;
            @ApiModelProperty(value = "广告计划投放状态,详见【附录-广告计划投放状态】(进入投放之前,优先披露审核状态,此时优先于启用暂停,启用暂停信息以opt_status为准)")
            private String status;
            @ApiModelProperty(value = "学习期状态\n" +
                    "            允许值：DEFAULT（默认，不在学习期中）、LEARNING（学习中）、LEARNED（学习成功）、LEARN_FAILED（学习失败）\n" +
                    "            关于学习期")
            private String learning_phase;
            @ApiModelProperty(value = "广告计划操作状态,详见【附录-广告计划操作状态】允许值: \"AD_STATUS_ENABLE\",\"AD_STATUS_DISABLE\"")
            private String opt_status;
            @ApiModelProperty(value = "广告投放起始时间")
            private String start_time;
            @ApiModelProperty(value = "广告投放结束时间")
            private String end_time;
            @ApiModelProperty(value = "广告投放时间类型, 详见【附录-广告投放时间类型】")
            private String schedule_type;
            @ApiModelProperty(value = "广告投放时段，默认全时段投放，格式是48*7位字符串，且都是0或1。也就是以半个小时为最小粒度，周一至周日每天分为48个区段，0为不投放，1为投放，不传、全传0、全传1均代表全时段投放")
            private String schedule_time;
            @ApiModelProperty(value = "广告投放速度类型, 详见【附录-广告投放速度类型】")
            private String flow_control_mode;
            @ApiModelProperty(value = "创意投放位置,详见【附录-投放位置】。创建选择优选广告位时，此字段回会返回对应的优选广告位")
            private String[] inventory_type;
            @ApiModelProperty(value = "转化类型广告的转化工具id，其中较小数值convert_id为预定义转化，具体枚举可查看【附录-预定义转化类型】")
            private Long convert_id;
            @ApiModelProperty(value = "转化类型，目前当推广类型为抖音时会返回，允许值：\"AD_CONVERT_TYPE_FOLLOW_ACTION\", \"AD_CONVERT_TYPE_MESSAGE_ACTION\", \"AD_CONVERT_TYPE_INTERACTION\"")
            private String[] external_actions;
            @ApiModelProperty(value = "过滤已转化用户类型字段。详见【附录-过滤已转化用户类型】")
            private String hide_if_converted;
            @ApiModelProperty(value = "过滤已安装，0：表示不过滤，1：表示过滤")
            private int hide_if_exists;
            @ApiModelProperty(value = "过滤时间范围，详见， 【附录-过滤时间范围】，可选值ONE_MONTH,THREE_MONTH,SIX_MONTH,TWELVE_MONTH")
            private String converted_time_duration;
            @ApiModelProperty(value = "门店ids，当推广类型为store时返回")
            private Long[] advertiser_store_ids;
            @ApiModelProperty(value = "应用直达链接")
            private String open_url;
            @ApiModelProperty(value = "应用下载方式，推广类型为APP时返回此字段")
            private String download_type;
            @ApiModelProperty(value = "广告落地页链接，当推广类型为link,或者且推广类型为APP且download_type为EXTERNAL_URL或者QUICK_APP_URL时返回此字段")
            private String external_url;
            @ApiModelProperty(value = "广告应用下载链接，当推广类型为APP且download_type为DOWNLOAD_URL时返回此字段")
            private String download_url;
            @ApiModelProperty(value = "快应用链接，当推广类型为APP且download_type为QUICK_APP_URL时返回此字段")
            private String quick_app_url;
            @ApiModelProperty(value = "广告应用下载类型，当推广类型为APP且download_type为DOWNLOAD_URL时或当推广类型为DPA且dpa_adtype为DPA_APP返回此字段")
            private String app_type;
            @ApiModelProperty(value = "广告应用下载包名，当推广类型为APP且download_type为DOWNLOAD_URL时或当推广类型为DPA且dpa_adtype为DPA_APP返回此字段")
            private String package_;
            @ApiModelProperty(value = "下载模式\n" +
                    "            允许值：APP_STORE_DELIVERY（白名单功能，仅安卓应用下载支持）、 DEFAULT当应用下载时，默认default下载，可选用APP_STORE_DELIVERY（应用商店直投），选择后，将优先跳转目标应用对应手机系统应用商店安装详情页，跳转失败则使用下载链接下载。请确保投放的应用在应用商店内已上架\n")
            private String download_mode;
            @ApiModelProperty(value = "产品目录ID(ID由查询产品目录接口得到), 当推广目的landing_type为DPA时返回")
            private Long product_platform_id;
            @ApiModelProperty(value = "dpa广告类型取值范围：DPA_LINK（dpa落地页）DPA_APP（dpa应用下载）")
            private String[] dpa_adtype;
            @ApiModelProperty(value = "DPA落地页类型广告落地页链接")
            private String[] dpa_external_urls;
            @ApiModelProperty(value = "DPA直达链接")
            private String[] dpa_open_urls;
            @ApiModelProperty(value = "DPA投放范围取值范围：NONE（不限）CATEGORY（指定类别）PRODUCT（指定商品）")
            private String category_type;
            @ApiModelProperty(value = "category_type取值范围为CATEGORY时必填，表示类别")
            private String[] dpa_categories;
            @ApiModelProperty(value = "category_type为PRODUCT时必填，表示商品列表")
            private String[] dpa_products;
            @ApiModelProperty(value = "H5地址参数(DPA推广目的特有,在填写的参数后面添加\"=urlencode(开放平台提供的h5链接地址）\"，其中urlencode(开放平台提供的h5链接地址）替换为商品库中的h5地址encode的结果)")
            private String external_url_params;
            @ApiModelProperty(value = "DPA直达链接参数(DPA推广目的特有,在“产品库中提取的scheme地址\"后面追加填写的参数)")
            private String open_url_params;
            @ApiModelProperty(value = "第三方唯一键，传该值时保证接口重试的幂等性，带有相同unique_fk的请求服务端会视为同一个广告处理。仅在创建接口传入且无法修改，如果创建时传入了已存在的唯一键值，那么会返回该唯一键值所对应的广告计划ID。该值可用于内部系统会生成的唯一ID与头条ID做关联的场景，避免超时重试实际上一次创建请求又成功导致的重复创建问题，通过unique_fk可与内部系统ID实现关联并避免重复创建，可结合实际场景选择使用，广告计划中的unique_fk要求不重复，与广告组中的unique_fk无相关。\n")
            private String unique_fk;
            @ApiModelProperty(value = "定向包ID")
            private Long audience_package_id;

            private Audience audience;

            @ApiModelProperty(value = "广告计划详细内容")
            private OceanengineReportPlanInfo.DataBean.ListBean reportdetail;
            @NoArgsConstructor
            @Data
            @ApiModel(value = "获取广告计划响应内容实体_广告受众")
            public static class Audience {
                /**
                 * page : 1
                 * page_size : 10
                 * total_number : 2
                 * total_page : 1
                 */
                @ApiModelProperty(value = "手机价格定向,传入价格区间，最高传入11000（表示1w以上）传值示例 \"launch_price\": [2000, 11000]，表示2000元以上")
                private Long[] launch_price;
                @ApiModelProperty(value = "行为兴趣选择\n" +
                        "                允许值：\"UNLIMITED\",\"CUSTOM\",\"RECOMMEND\"")
                private String interest_action_mode;
                @ApiModelProperty(value = "行为场景，详见【附录-行为场景】\n" +
                        "                允许值：\"E-COMMERCE\", \"NEWS\", \"APP\"")
                private String[] action_scene;
                @ApiModelProperty(value = "行为天数\n" +
                        "                允许值：7, 15, 30, 60, 90, 180, 365")
                private Integer action_days;
                @ApiModelProperty(value = "行为类目")
                private Long[] action_categories;
                @ApiModelProperty(value = "行为关键词")
                private Long[] action_words;
                @ApiModelProperty(value = "兴趣分类,如果传空数组 [] 表示不限，如果只传[0]表示系统推荐,如果按兴趣类型传表示自定义")
                private Long[] interest_categories;
                @ApiModelProperty(value = "兴趣关键词, 传入具体的词id，非兴趣词包id，可以通过词包相关接口或者兴趣关键词word2id接口获取词id，一个计划下最多创建1000个关键词。")
                private Long[] interest_words;
                @ApiModelProperty(value = "账号粉丝相似人群（添加抖音账号，会将广告投放给对应账号的相似人群粉丝）")
                private Long[] aweme_fans_numbers;
                @ApiModelProperty(value = "过滤高活跃用户\n" +
                        "                允许值：0表示不过滤，1表示过滤")
                private Long filter_aweme_abnormal_active;
                @ApiModelProperty(value = "过滤高关注数用户，例如\"filter_aweme_fans_count\": 1000表示过滤粉丝数在1000以上的用户")
                private Long filter_aweme_fans_count;
                @ApiModelProperty(value = "过滤自己的粉丝\n" +
                        "                允许值：0表示不过滤，1表示过滤")
                private Long filter_own_aweme_fans;
                @ApiModelProperty(value = "抖音号，过滤自己的粉丝，抖音特有")
                private Long own_aweme_number;
                @ApiModelProperty(value = "定向人群包列表，内容为人群包id。（新增字段，使用新增字段支持同时选择定向和排除）")
                private Long[] retargeting_tags_include;
                @ApiModelProperty(value = "排除人群包列表，内容为人群包id。（新增字段，使用新增字段支持同时选择定向和排除）")
                private Long[] retargeting_tags_exclude;
                @ApiModelProperty(value = "受众性别, 详见【附录-受众性别】")
                private String gender;
                @ApiModelProperty(value = "受众年龄区间, 详见【附录-受众年龄区间】")
                private String[] age;
                @ApiModelProperty(value = "受众最低android版本, 详见【附录-受众android版本】")
                private String android_osv;
                @ApiModelProperty(value = "受众最低ios版本, 详见【附录-受众ios版本】")
                private String ios_osv;
                @ApiModelProperty(value = "受众网络类型, 详见【附录-受众网络类型】")
                private String[] ac;
                @ApiModelProperty(value = "受众手机品牌, 详见【附录-手机品牌】")
                private String[] device_brand;
                @ApiModelProperty(value = "受众文章分类, 详见【附录-受众文章分类】")
                private String[] article_category;
                @ApiModelProperty(value = "受众平台, 详见【附录-受众平台类型】")
                private String[] platform;
                @ApiModelProperty(value = "受众运营商, 详见【附录-受众运营商类型】")
                private String[] carrier;
                @ApiModelProperty(value = "（老版）兴趣分类,如果传空数组 ] 表示不限，如果只传[0]表示系统推荐,如果按兴趣类型传表示自定义，兴趣类型详见[【附件-ad_tag.json】")
                private Long[] ad_tag;
                @ApiModelProperty(value = "用户首次激活时间, 详见【附录-用户首次激活时间】")
                private String[] activate_type;
                @ApiModelProperty(value = "（老版）兴趣关键词, 返回值为词id，非兴趣词包id，可通过兴趣词包接口id2word获取具体词")
                private Long[] interest_tags;
                @ApiModelProperty(value = "受众位置类型，详见【附录-受众位置类型】")
                private String location_type;
                @ApiModelProperty(value = "地域类型，前者为省市，后者为区县。当city有数据时，必填。\n" +
                        "                允许值: \"CITY\", \"COUNTY\", \"BUSINESS_DISTRICT\",\"NONE\"")
                private String district;
                @ApiModelProperty(value = "地域定向城市列表(当传递省份ID时,旗下市县ID可省略不传), 详见【附件-city.json】")
                private Long[] city;
                @ApiModelProperty(value = "商圈ID数组")
                private Long[] business_ids;
                @ApiModelProperty(value = "APP行为定向, 详见【附录-APP行为定向类型】（请注意如果投放的是应用下载-IOS不支持设置APP行为定向，请勿传值。）")
                private String app_behavior_target;
                @ApiModelProperty(value = "APP行为定向,分类集合, 详见【附件-app_category.json】（请注意如果投放的是应用下载-IOS不支持设置APP行为定向，请勿传值。）")
                private Long[] app_category;
                @ApiModelProperty(value = "APP行为定向,APP集合（请注意如果投放的是应用下载-IOS不支持设置APP行为定向，请勿传值。）")
                private Long[] app_ids;
                @ApiModelProperty(value = "DPA人群定向(DPA推广目的特有)取值范围：NONE（不限）CUSTOM（自定义）")
                private Long dpa_local_audience;

                @ApiModelProperty(value = "精选流量包，详见【附录-精选流量包】")
                private String superior_popularity_type;
                @ApiModelProperty(value = "定向流量包ID数组")
                private Long[] flow_package;
                @ApiModelProperty(value = "排除流量包ID数组")
                private Long[] exclude_flow_package;
                @ApiModelProperty(value = "设备类型。返回 null 表示没有设置，即不限。")
                private String[] device_type;
                @ApiModelProperty(value = "是否启用智能放量")
                private Long auto_extend_enabled;
                @ApiModelProperty(value = "可放开定向。当没有开启智能放量时，返回 null")
                private String[] auto_extend_targets;
                @ApiModelProperty(value = "抖音号id，与aweme_fan_behaviors同时设置才会生效（抖音达人定向）")
                private Long[] aweme_fan_accounts;
                @ApiModelProperty(value = "抖音类目id，与aweme_fan_behaviors同时设置才会生效（抖音达人定向")
                private Long[] aweme_fan_categories;
                @ApiModelProperty(value = "抖音用户行为类型, 详见【附录-抖音用户行为类型】\n" +
                        "                允许值:\n" +
                        "                        \"FOLLOWED_USER\",\"COMMENTED_USER\",\"LIKED_USER\",\"SHARED_USER\"（抖音达人定向）")
                private String[] aweme_fan_behaviors;




                @ApiModelProperty(value = "包含人群包")
                private List<CustomActions> include_custom_actions;
                @ApiModelProperty(value = "排除人群包")
                private List<CustomActions> exclude_custom_actions;


                @NoArgsConstructor
                @Data
                @ApiModel(value = "获取广告计划响应内容实体_广告受众_人群包")
                public static class CustomActions {
                    @ApiModelProperty(value = "天数")
                    private Long days;
                    @ApiModelProperty(value = "code码，候选范围由查询行为人群库接口得到")
                    private Long code;

                }

                private List<Geolocation> geolocation;

                @NoArgsConstructor
                @Data
                @ApiModel(value = "获取广告计划响应内容实体_广告受众_地图位置")
                public static class Geolocation {
                    @ApiModelProperty(value = "地点名字")
                    private Long radius;
                    @ApiModelProperty(value = "地图位置")
                    private String name;
                    @ApiModelProperty(value = "经度")
                    private Float Long_;
                    @ApiModelProperty(value = "纬度")
                    private Float lat;
                    @ApiModelProperty(value = "城市")
                    private String city;
                    @ApiModelProperty(value = "街道号")
                    private String street_number;
                    @ApiModelProperty(value = "街道名")
                    private String street;
                    @ApiModelProperty(value = "区域名")
                    private String district;
                    @ApiModelProperty(value = "省份名")
                    private String province;

                }
            }

        }

    }
}
